package com.usian.behavior.controller;

import com.usian.behavior.service.LikeBehaviorService;
import com.usian.model.behavior.dtos.LikesBehaviorDto;
import com.usian.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class LikeController {
    @Autowired
    private LikeBehaviorService service;
    @PostMapping("like/or/cancel")
    ResponseResult like(@RequestBody LikesBehaviorDto dto){
        return service.likeOpr(dto);
    }

    @GetMapping("getLikeStatus/{userId}/{articleId}")
    public Boolean getLikeStatus(@PathVariable Integer userId, @PathVariable Long articleId){
        return service.getLikeStatus(userId,articleId);
    }
}
